package com.qcu.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 
 * @TableName appointment_temp
 */
@TableName(value ="appointment_temp")
@Data
public class AppointmentTemp implements Serializable {
    /**
     * 主键
     */
    @TableId
    private String id;

    /**
     * 请求人ID
     */
    private String inhabitantId;
    private String email;
    private String subscribe;
    private String result;
    /**
     * 性别 0 男 1 女
     */
    private String gender;
    /**
     * 预约项目
     */
    private String item;
    /**
     * 预约医生id
     */
    private Integer doctorId;
    /**
     * 请求时间
     */
    private Date subTime;
    /**
     * 接收时间
     */
    private Date agreeTime;
    /**
     * 状态 0 已请求 1 已接受 2 已完成
     */
    private Integer state;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        AppointmentTemp other = (AppointmentTemp) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getInhabitantId() == null ? other.getInhabitantId() == null : this.getInhabitantId().equals(other.getInhabitantId()))
            && (this.getGender() == null ? other.getGender() == null : this.getGender().equals(other.getGender()))
            && (this.getItem() == null ? other.getItem() == null : this.getItem().equals(other.getItem()))
            && (this.getDoctorId() == null ? other.getDoctorId() == null : this.getDoctorId().equals(other.getDoctorId()))
            && (this.getSubTime() == null ? other.getSubTime() == null : this.getSubTime().equals(other.getSubTime()))
            && (this.getAgreeTime() == null ? other.getAgreeTime() == null : this.getAgreeTime().equals(other.getAgreeTime()))
            && (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getInhabitantId() == null) ? 0 : getInhabitantId().hashCode());
        result = prime * result + ((getGender() == null) ? 0 : getGender().hashCode());
        result = prime * result + ((getItem() == null) ? 0 : getItem().hashCode());
        result = prime * result + ((getDoctorId() == null) ? 0 : getDoctorId().hashCode());
        result = prime * result + ((getSubTime() == null) ? 0 : getSubTime().hashCode());
        result = prime * result + ((getAgreeTime() == null) ? 0 : getAgreeTime().hashCode());
        result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", inhabitantId=").append(inhabitantId);
        sb.append(", gender=").append(gender);
        sb.append(", item=").append(item);
        sb.append(", doctorId=").append(doctorId);
        sb.append(", subTime=").append(subTime);
        sb.append(", agreeTime=").append(agreeTime);
        sb.append(", state=").append(state);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}